package java面向对象.构造方法;
//构造方法的重载
public class Student1 {
    private String name;
    private int age;

    public Student1() {
        System.out.println("无参构造方法");
    }

    public Student1(String name) {
        this.name = name;
        System.out.println("有一个参数的构造方法");
    }

    public Student1(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("有两个参数的构造方法");
        System.out.println("姓名："+name+"年龄："+age);


    }
}
